#ifndef OBJECT_H_INCLUDED
#define OBJECT_H_INCLUDED

#include "XGE_Common.h"
#include "Element.h"
#include "ObjectComponent.h"

namespace XGE
{
    class Object : public XGE::Element
    {
        protected:
            XGE::ObjectComponentMap components;
            XGE::Object* owner;
            void* data;

            //Type Identifier
            Ogre::uint32 typeID;

        public:
            Object(const Ogre::String& nName) : Element(nName) {};

            //TODO: Figure out deletion schema based on active status
            ~Object(){};

            //Set and Get Object Data (Should be Supertype; Actor, Weapon, Trigger, etc.)
            void setData(void* nData) { data = nData; };
            void* getData(void) { return data; };

            //Set and Get Object's Owner Object(If this is an owned object)
            void setOwner(XGE::Object* nOwner) { owner = nOwner; };
            XGE::Object* getOwner(void) { return owner; };

            //Returns a map pointer of this Object's components
            XGE::ObjectComponentMap& getComponents(void) { return components; };

            //Sets the TypeID of this Object (Supertype ID, generally enumerated; OBJ_ACTOR, OBJ_WEAPON, OBJ_TRIGGER, etc)
            void setTypeID(const Ogre::uint32& nID) { typeID = nID; };
            const Ogre::uint32& getTypeID(void) { return typeID; };

            //Update this object
            virtual bool _update(void) = 0;
    };
}

#endif // OBJECT_H_INCLUDED
